<?php
$FILE = 'upload/' . $_GET["nid"] . '/' .$_GET["filename"];
$FILE_NAME = $_GET["filename"];
if ($fd = fopen ($FILE, "r")) {
	header("Content-type: application/force-download");
	header("Content-Transfer-Encoding: Binary");
	header("Content-length: " . filesize($FILE));
	header("Content-disposition: attachment; filename=\"" . $FILE_NAME . "\"");
	while(!feof($fd)) {
		$buffer = fread($fd, 2048);
		echo $buffer;
		flush();
	}
	fclose ($fd);
}
?>